<template>
  <div class="flow-editor-node route">
    <div class="top-h-line"></div>
    <div class="add-branch">
      <div class="add-branch-inner">
        {{ $attrs.diagramMode ? LANG.BRANCH : LANG.ADD_CONDITION }}
        <i class="iconfont-approval-admin icon-arrow"></i>
      </div>
    </div>
    <div class="branches">
      <sub-branch
        v-for="(item, index) in nodeConfig.branches"
        :key="index"
        :nodeConfig="item"
        :branch_index="index"
        :isDefault="item.sort == nodeConfig.branches.length - 1"
        v-bind="$attrs"
      ></sub-branch>
    </div>
    <div class="bottom-h-line"></div>
    <div class="bottom-v-line"></div>
    <div v-if="!$attrs.diagramMode" class="add-node-btn"></div>
  </div>
</template>

<script>
export default {
  name: 'route',
  componentName: 'route-custom',
  components: { SubBranch: () => import('../branch/index.vue') },
  props: {
    nodeConfig: {
      type: Object,
      default: () => {
        return {
          branches: []
        }
      }
    },
    node_index: {
      type: Number,
      default: 0
    }
  }
}
</script>

<style></style>
